import { AbstractAPI } from './abstract_api'
import { PyWebviewWindow } from './pywebview'

export class BaseComponent {
  window: PyWebviewWindow
  constructor() {
    const w = window as any
    w['log'] = (msg: string) => {
      console.log(msg)
    }
    this.window = w
  }

  api(): AbstractAPI {
    return this.window.pywebview.api
  }
}
